Improve action-namespace example
authorMatthias Clasen <mclasen@redhat.com>
Wed, 3 Dec 2014 00:13:24 +0000 (19:13 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 3 Dec 2014 02:00:24 +0000 (21:00 -0500)
This needs to have some space around the button for the popover
to show up.

examples/action-namespace.c

index 16d48cb64d1e1e2f0d3b3d8eaf4e822961496408..7335ad993e90f742f97300667d657030cee067e2 100644 (file)
@@ -81,6 +81,7 @@ activate (GApplication *app,
     return;
 
   win = gtk_application_window_new (GTK_APPLICATION (app));
+  gtk_window_set_default_size (GTK_WINDOW (win), 200, 300);
 
   doc_actions = g_simple_action_group_new ();
   g_action_map_add_action_entries (G_ACTION_MAP (doc_actions), doc_entries, G_N_ELEMENTS (doc_entries), win);
@@ -110,7 +111,8 @@ activate (GApplication *app,
   gtk_button_set_label (GTK_BUTTON (button), "Menu");
   gtk_widget_insert_action_group (button, "doc", G_ACTION_GROUP (doc_actions));
   gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), G_MENU_MODEL (button_menu));
-
+  gtk_widget_set_halign (GTK_WIDGET (button), GTK_ALIGN_CENTER);
+  gtk_widget_set_valign (GTK_WIDGET (button), GTK_ALIGN_START);
   gtk_container_add (GTK_CONTAINER (win), button);
   gtk_container_set_border_width (GTK_CONTAINER (win), 12);
   gtk_widget_show_all (win);